<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

	<head>
		<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
		<link rel="stylesheet" href="http://127.0.0.1/vancl_php/Application/Index/View/css/style.css" />
		<link rel="stylesheet" href="http://127.0.0.1/vancl_php/Application/Index/View/css/index.css" />
		<link rel="stylesheet" href="http://127.0.0.1/vancl_php/Application/Index/View/css/commonjs.css" />
		<script>
			var showCart = "<?php echo U('Cart/ajaxGoods');?>";
			var app = "<?php echo U('Details/index');?>";
			var delCart = "<?php echo U('Cart/delCart');?>";
			var root = "http://127.0.0.1/vancl_php/";
			var getgoods = "<?php echo U('getGoodsName');?>";
			var search = "<?php echo U('Search/index');?>";
			var showlist = "<?php echo U('List/index');?>";
		</script>
		<script src="http://127.0.0.1/vancl_php/Static/js/jquery-1.7.2.min.js"></script>
		<script src="http://127.0.0.1/vancl_php/Application/Index/View/js/showCart.js"></script>
		<script src="http://127.0.0.1/vancl_php/Static/js/common.js"></script>
		<script src="http://127.0.0.1/vancl_php/Application/Index/View/js/indexTruns.js"></script>
		
		<title>Vancl凡客----首页</title>
		<style type="text/css">
			.navFirst::after{
				background:none !important;
			}
		</style>
	</head>

	<body>
		<!-- 头部开始  -->
		<div id="header">
			<!-- 头部广告位置 -->
			<div class="adWrap">
				<div class="headAd">
					<a href="">
						<img src="http://127.0.0.1/vancl_php/Application/Index/View/Img/head_top_ad.jpg" alt="头部广告位" />
					</a>
				</div>
				<!-- 头部广告位置结束 -->
			</div>
			<!--头部登陆信息开始-->
			<div class="toptopare">
				<div class="arewarp">
					<!--左边欢迎登陆文字开始-->
						<div class="welcome">
							    <?php if(isset($hd['session']['uid'])){ ?>
								 您好！
							 <a href="<?php echo U('UserInfo/index');?>" style="color:#B81B22;font-weight: 700;"><?php echo $hd['session']['username'];?></a>
							 <a href="<?php echo U('Login/loginout');?>" style="color:#B81B22;">退出登录</a>
							<?php }else{ ?>
							您好,欢迎光临凡客诚品！
							<span class="loginreg">
								<a href="<?php echo U('Login/index');?>">登陆</a>
								｜ 
								<a href="<?php echo U('Register/index');?>">注册</a>
							</span>
							<?php } ?>
						</div>
					<!--左边欢迎登陆文字结束-->
					<!--订单收藏-->
						<div class="orderads">
							<a href="<?php echo U('UserInfo/OrderList');?>">我的订单</a>
								 
							<!--<a href="">收藏本站</a>-->
						</div>
					<!--订单收藏结束-->
					<!-- 右边下拉列表-->
					<div class="droplist">
						<div href="" id="myVancl" class="mylist">
							<a href="<?php echo U('UserInfo/index');?>">我的凡客 <span class="jt"></span></a>
							<ul class="myVanclList">
								<li><a href="<?php echo U('UserInfo/OrderList');?>">我的订单</a></li>
								<li class="liBottom"><a href=""></a></li>
							</ul>
						</div>
						<div href="" class="mylist">
							<a href="">网站导航 <span class="jt"></span></a>
							<ul class="myVanclList">
								<li><a href="<?php echo U('UserInfo/OrderList');?>">我的订单</a></li>
								<li class="liBottom"><a href=""></a></li>
							</ul>
						</div>
						<div href="" class="mylist">
							<a href="">帮助中心 <span class="jt"></span></a>
							<ul class="myVanclList">
								<li><a href="">购物指南</a></li>
								<li><a href="">配送方式</a></li>
								<li><a href="">支付方式</a></li>
								<li><a href="">售后服务</a></li>
								<li><a href="">投诉建议</a></li>
								<li><a href="">在线客户</a></li>
								<li class="liBottom"><a href=""></a></li>
							</ul>
						</div>
						<div href="" class="mylist">
							<a href="">网站公告 <span class="jt"></span></a>
							<ul class="myVanclList">
								<li><a href="">我的订单</a></li>
								<li class="liBottom"><a href=""></a></li>
							</ul>
						</div>
					</div>
					<!--右边下拉列表结束-->
				</div>
			</div>
			<!--头部登陆信息结束-->
			<!--logo和搜索条-->
			<div class="logoArea">
				<!--logo-->
				<a href="" class="logo"></a>
				<!--logo结束-->
				<!--搜索区开始-->
				<div class="serachArea">
					<div class="searchTopAre">
					<!--搜索框-->
					<div class="searchInput">
						<form action="<?php echo U('Search/index');?>" method="get">
							<input type="text" name="searchkey" autocomplete="off" id="inputBox"/>
							<div class="inputbox" >
							</div>
							<input type="submit" id="searchBtn" value="搜索" />
						</form>
					</div>
					<!--购物车-->
					<div class="shopCart">
						<a href="<?php echo U('Cart/index');?>" style="color:white">购物车</a>(<span class="carNum">    <?php if(isset($hd['session']['cart']['total_rows'])){ ?><?php echo $hd['session']['cart']['total_rows'];?><?php }else{ ?>0<?php } ?></span>)
						<div class="showCartList">
							<!--目前没有商品-->
							<p class="cartTitle">最近加入购物车</p>
							<ul>
								
							</ul>
							<!--购物车底部-->
							<div class="cartBottom">
								<div class="left">
									共计
									<p>￥0.00元</p>
								</div>
								<!--右边进入详细购物车页-->
								<div class="right">
									<a href="<?php echo U('Cart/index');?>">查看购物车</a>
								</div>
							</div>
						</div>
					</div>
					<!--购物车结束-->
					</div>
					<!--热门搜索-->
					<div class="hotKeyword">
						<!--<span>热门搜索:</span>
						<a href="">吉武国</a>
						<a href="">T恤</a>
						<a href="">卡其裤</a>
						<a href="">长场雄</a>
						<a href="">POLO</a>
						<a href="">麻牛仔</a>
						<a href="">皮肤衣</a>
						<a href="">牛津纺</a>-->
					</div>
					<!--热门搜索结束-->
					
					<!--搜索框结束-->
				</div>
				<!--搜索区结束-->
			</div>
			<!--logo和搜索条结束-->
			<!--导航区-->
			<div id="navbar">
				<div class="navFirst">
					全部商品分类
					
				</div>
				<div class="navList">
					<ul>
						<?php foreach ($topCate as $key=>$val){?>
						<li><a href="<?php echo U('List/index',array('cid'=>$val['cid']));?>" title=<?php echo $val['ckeywords'];?>><?php echo $val['cname'];?></a>
							<!--当前这个分类下页推荐的2个商品-->
							<div class="cateProduct">
								<!--分页推荐商品左边-->
								<?php foreach ($val['son'][0] as $kk=>$vv){?>
								<div class="productLeft"     <?php if($kk==1){ ?>style="border:none;"<?php } ?>>
									<div class="wrapProduct">
										<a href="http://127.0.0.1/vancl_php/index.php/Index/Details/index/gid/<?php echo $vv['gid'];?>">
											<img src="http://127.0.0.1/vancl_php/<?php echo $vv['goods_listimg'];?>" alt="" width="140" height="140" />
										</a>
										<p class="goods">
											<a href="http://127.0.0.1/vancl_php/index.php/Index/Details/index/gid/<?php echo $vv['gid'];?>"><?php echo hd_substr($vv['goods_name'],8,'');?></a>
										</p>
										<div class="goodsDesc">
											
											<p class="goodsPrice" style="margin-top:50px;margin-left:20px;">
											￥<?php echo $vv['shop_price'];?>
											</p>
										</div>
										
									</div>
								</div>
								<?php }?>
							</div>
						</li>
						<?php }?>
					</ul>
				</div>
			</div>
			<!--导航区结束-->
		</div>
		<!-- 头部结束  -->
		<!-- 内容开始 -->
		<div id="content">
			<!--左边分类菜单列表-->
			<div id="leftCategoryList">
				<!--遍历左边分类菜单列表-->
				<?php foreach ($rightCateTree as $key=>$val){?>
				<dl>
					<h3><?php echo $val['cname'];?></h3>
					<?php foreach ($val['son'] as $k=>$v){?>
					<dt>
						<a href="http://127.0.0.1/vancl_php/index.php/Index/List/index/cid/<?php echo $v['cid'];?>" title="<?php echo $v['ckeywords'];?>"><?php echo $v['cname'];?></a>
					</dt>
					<dd>
						<?php foreach ($v['son'] as $ky=>$vl){?>
							<a href="http://127.0.0.1/vancl_php/index.php/Index/List/index/cid/<?php echo $vl['cid'];?>"     <?php if($vl['is_hot']==1){ ?>class="hot"<?php }else{ ?>class="nothot"<?php } ?> ><?php echo $vl['cname'];?></a>
						<?php }?>
					</dd>
					<?php }?>
					
				</dl>
				<?php }?>
				<!--遍历左边分类菜单列表-->
				
			</div>
			<!--左边分类列表结束-->
			<!-- 轮播图和小广告 -->
			<div id="fr">
				<!--轮播图-->
				<div class="lbtTab" id="indexTruns">
					<!--轮播大图片-->
					<ul class="listImg">
						<?php foreach ($turnimg as $ik=>$iv){?>
						<li>
							<a href="http://<?php echo $iv['link'];?>"><img src="http://127.0.0.1/vancl_php/<?php echo $iv['imgpath'];?>" alt="<?php echo $iv['desc'];?>" title="<?php echo $iv['desc'];?>" /></a>
						</li>
						<?php }?>
					</ul>
					<!--轮播图按钮-->
					<ul class="listBtn">
						        <?php
        //初始化
        $hd['list']['iiv'] = array(
            'first' => false,
            'last'  => false,
            'total' => 0,
            'index' => 0
        );
        if (empty($turnimg)) {
            echo '';
        } else {
            $listId = 0;
            $listShowNum=0;
            $listNextId=0;
            foreach ($turnimg as $iiv) {
                //开始值
                if ($listId<0) {
                    $listId++;
                    continue;
                }
                //步长
                if($listId!=$listNextId){$listId++;continue;}
                //显示条数
                if($listShowNum>=100)break;
                //第几个值
                $hd['list'][iiv]['index']++;
                //第1个值
                $hd['list'][iiv]['first']=($listId == 0);
                //最后一个值
                $hd['list'][iiv]['last']= (count($turnimg)-1 <= $listId);
                //总数
                $hd['list'][iiv]['total']++;
                //增加数
                $listId++;
                $listShowNum++;
                $listNextId+=1
                ?>
							    <?php if($hd['list']['iiv']['first']){ ?>
								<li style="background:red;"></li>
								<?php }else{ ?>
								<li></li>
							<?php } ?>
						<?php }}?>
					</ul>
				</div>
				<!--轮播图-->
				<div class="smallAd">
					<a href="<?php echo U('Search/index',array('searchkey'=>'衬衫'));?>"><img src="http://127.0.0.1/vancl_php/Application/Index/View/Img/y2.jpg" alt="" /></a>
					<a href="<?php echo U('Search/index',array('searchkey'=>'凡客T恤'));?>"><img src="http://127.0.0.1/vancl_php/Application/Index/View/Img/yct1g.jpg" alt="" /></a>
				</div>
			</div>			
			<!-- 轮播图和小广告结束 -->
			<span class="clearfix"></span>
			<!--新品上架-->
				<div id="newShipping">
					<div class="title">
						新品上市 
					</div>
					<!--新品详细-->
					<div class="shopList">
						<ul>
							        <?php
        //初始化
        $hd['list']['val'] = array(
            'first' => false,
            'last'  => false,
            'total' => 0,
            'index' => 0
        );
        if (empty($newgoods)) {
            echo '';
        } else {
            $listId = 0;
            $listShowNum=0;
            $listNextId=0;
            foreach ($newgoods as $val) {
                //开始值
                if ($listId<0) {
                    $listId++;
                    continue;
                }
                //步长
                if($listId!=$listNextId){$listId++;continue;}
                //显示条数
                if($listShowNum>=6)break;
                //第几个值
                $hd['list'][val]['index']++;
                //第1个值
                $hd['list'][val]['first']=($listId == 0);
                //最后一个值
                $hd['list'][val]['last']= (count($newgoods)-1 <= $listId);
                //总数
                $hd['list'][val]['total']++;
                //增加数
                $listId++;
                $listShowNum++;
                $listNextId+=1
                ?>
							<li>
								<div>
									<a href="http://127.0.0.1/vancl_php/index.php/Index/details/index/gid/<?php echo $val['gid'];?>">
										<img src="http://127.0.0.1/vancl_php/<?php echo $val['goods_listimg'];?>" alt="" width="185" height="230" />
									</a>
									<h3>
										<a href=""><?php echo hd_substr($val['goods_name'],9,'');?>&nbsp;<span style="font-family: '微软雅黑';font-weight:700;color:#B81B22"><?php echo $val['shop_price'];?></span>元</a>
									</h3>
								</div>
							</li>
							<?php }}?>						
						</ul>
					</div>
					<div class="shopList" style="margin-top:10px;">
						<ul>
							        <?php
        //初始化
        $hd['list']['vval'] = array(
            'first' => false,
            'last'  => false,
            'total' => 0,
            'index' => 0
        );
        if (empty($newgoods)) {
            echo '';
        } else {
            $listId = 0;
            $listShowNum=0;
            $listNextId=6;
            foreach ($newgoods as $vval) {
                //开始值
                if ($listId<6) {
                    $listId++;
                    continue;
                }
                //步长
                if($listId!=$listNextId){$listId++;continue;}
                //显示条数
                if($listShowNum>=6)break;
                //第几个值
                $hd['list'][vval]['index']++;
                //第1个值
                $hd['list'][vval]['first']=($listId == 6);
                //最后一个值
                $hd['list'][vval]['last']= (count($newgoods)-1 <= $listId);
                //总数
                $hd['list'][vval]['total']++;
                //增加数
                $listId++;
                $listShowNum++;
                $listNextId+=1
                ?>
							<li>
								<div>
									<a href="http://127.0.0.1/vancl_php/index.php/Index/details/index/gid/<?php echo $vval['gid'];?>">
										<img src="http://127.0.0.1/vancl_php/<?php echo $vval['goods_listimg'];?>" alt="" width="185" height="230" />
									</a>
									<h3>
										<a href=""><?php echo hd_substr($vval['goods_name'],9,'');?>&nbsp;<span style="font-family: '微软雅黑';font-weight:700;color:#B81B22"><?php echo $vval['shop_price'];?></span>元</a>
									</h3>
								</div>
							</li>
							<?php }}?>						
						</ul>
					</div>
					<!--新品详细 结束-->
				</div>
			<!--新品上架-->
			<div id="hotShipping">
				<div class="title">
					<h2>热销商品</h2>
				</div>
				<!-- 大图展示区-->
				<div class="proProduct">
					<!--上排图片-->
					<div class="topImgTab">
						<!--第一块图片-->
						<div class="imagea">
							<a href="<?php echo U('Search/index',array('searchkey'=>'T恤'));?>">
								<img src="http://127.0.0.1/vancl_php/Application/Index/View/Img/rx1g.jpg" alt="" width="708" />
							</a>
						</div>
						<!--第二块图-->
						<div class="imageb">
							<a href="<?php echo U('Search/index',array('searchkey'=>'牛仔裤'));?>">
								<img src="http://127.0.0.1/vancl_php/Application/Index/View/Img/rx2g4.jpg" alt="" width="489" />
							</a>
						</div>
					</div>
					<!--上排图片-->
					<!--下排图片-->
					<div class="bottomImgTab">
						<div class="bottomImg">
							<a href="<?php echo U('Search/index',array('searchkey'=>'皮肤衣'));?>">
								<img src="http://127.0.0.1/vancl_php/Application/Index/View/Img/rx3g3.jpg" alt="" width="399"/>
							</a>
						</div>
						<div class="bottomImg bothborder">
							<a href="<?php echo U('Search/index',array('searchkey'=>'运动裤'));?>">
								<img src="http://127.0.0.1/vancl_php/Application/Index/View/Img/rx4g3.jpg" alt="" width="398" />
							</a>
						</div>
						<div class="bottomImg">
							<a href="<?php echo U('Search/index',array('searchkey'=>'卡其裤'));?>">
								<img src="http://127.0.0.1/vancl_php/Application/Index/View/Img/rx5g3.jpg" alt=""  width="399" />
							</a>
						</div>
					</div>
					<!--下排图片-->
				</div>
				<!--大图展示区结束-->
				
			</div>
		</div>
		<!-- 内容结束 -->

		<!-- 页脚开始 -->
		<div id="foot">
			<div class="footerList">
				<div class="center">
					<dl>
						<dt><a href="">关于凡客</a></dt>
						<dd><a href="">公司简介</a></dd>
						<dd><a href="">联系我们</a></dd>
						<dd><a href="">友情链接</a></dd>
						
					</dl>
					<dl>
						<dt><a href="">新手指南</a></dt>
						<dd><a href="">账户注册</a></dd>
						<dd><a href="">购物流程</a></dd>
						<dd><a href="">网站地图</a></dd>
						<dd><a href="">商家入驻</a></dd>
					</dl>
					<dl>
						<dt><a href="">配送范围及时间</a></dt>
						<dd><a href="">国内配送</a></dd>
						<dd><a href="">订单拆分</a></dd>
						
					</dl>
					<dl>
						<dt><a href="">支付方式</a></dt>
						<dd><a href="">货到付款</a></dd>
						<dd><a href="">在线支付</a></dd>
						<dd><a href="">礼品卡及账户余额</a></dd>
						<dd><a href="">其他支付方式</a></dd>
						
					</dl>
					<dl>
						<dt><a href="">售后服务</a></dt>
						<dd><a href="">退换货政策</a></dd>
						<dd><a href="">退换货办理流程</a></dd>
						<dd><a href="">退换货网上办理</a></dd>
						<dd><a href="">退款说明</a></dd>
						<dd><a href="">调查问卷</a></dd>
						
					</dl>
					<dl style="border:none;">
						<dt><a href="">帮助中心</a></dt>
						<dd><a href="">在线客服</a></dd>
						<dd><a href="">找回密码</a></dd>
						<dd><a href="">隐私声明</a></dd>
						
					</dl>
				</div>
			</div>
			<!--条款图片-->
			<div class="footerListImg">
				<div class="wrapImg">
					<a href="" class="img1"></a>
				</div>
				<div class="wrapImg">
					<a href="" class="img2"></a>
				</div>
				<div class="wrapImg">
					<a href="" class="img3"></a>
				</div>
				<div class="wrapImg">
					<a href="" class="img4"></a>
				</div>
				
			</div>
			<!--条款图片结束-->
			<!--版权信息和工商-->
			<div class="footerBotoom">
				<div class="copy">
					Copyright 2007 - 2014 vancl.com All Rights Reserved 京ICP证100557号 京公网安备11011502002400号 出版物经营许可证新出发京批字第直110138号
				</div>
				<div class="gsImg">
					<div class="wrapFootImg">
					<a href="" class="gsImg1"></a>
					<a href="" class="gsImg2"></a>
					<a href="" class="gsImg3"></a>
					<a href="" class="gsImg4"></a>
					<a href="" class="gsImg5"></a>
					</div>
				</div>
				
			</div>
			<!--版权信息和工商-->
			
		</div>
		<!-- 页脚结束 -->

	</body>

</html>